﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class success : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["currentUser"] != null)
        {
            User u = (User)Session["currentUser"];
            this.user.Text = u.getUsername();
            this.age.Text = u.getAge();
            if (Session["remeber"]==null) {
                Session.Abandon();
                Button1.Visible = false;
            }
            
        }
        else {
            Response.Redirect("login.aspx");
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Session["currentUser"] = null;
        Session["remeber"] = null;
        Response.Redirect("login.aspx");
    }
}